home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  3.9 KB  |  121 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CommResources.p
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CommResources;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __COMMRESOURCES__}
  30. {$SETC __COMMRESOURCES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CommResourcesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40. {    Types.p                                                        }
  41. {        ConditionalMacros.p                                        }
  42. {    MixedMode.p                                                    }
  43. {    Memory.p                                                    }
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. CONST
  50. {    tool classes (also the tool file types)    }
  51.     classCM                        = 'cbnd';
  52.     classFT                        = 'fbnd';
  53.     classTM                        = 'tbnd';
  54.  
  55. {    version of the Comm Resource Manager    }
  56.     curCRMVersion                = 2;
  57. { constants general to the use of the Communications Resource Manager }
  58.     crmType                        = 9;                            { queue type    }
  59.     crmRecVersion                = 1;                            { version of queue structure }
  60. {    error codes }
  61.     crmGenericError                = -1;
  62.     crmNoErr                    = 0;
  63.  
  64. { data structures general to the use of the Communications Resource Manager }
  65.     
  66. TYPE
  67.     CRMErr = OSErr;
  68.  
  69.     CRMRec = RECORD
  70.         qLink:                    QElemPtr;                                {reserved}
  71.         qType:                    INTEGER;                                {queue type -- ORD(crmType) = 9}
  72.         crmVersion:                INTEGER;                                {version of queue element data structure}
  73.         crmPrivate:                LONGINT;                                {reserved}
  74.         crmReserved:            INTEGER;                                {reserved}
  75.         crmDeviceType:            LONGINT;                                {type of device, assigned by DTS}
  76.         crmDeviceID:            LONGINT;                                {device ID; assigned when CRMInstall is called}
  77.         crmAttributes:            LONGINT;                                {pointer to attribute block}
  78.         crmStatus:                LONGINT;                                {status variable - device specific}
  79.         crmRefCon:                LONGINT;                                {for device private use}
  80.     END;
  81.  
  82.     CRMRecPtr = ^CRMRec;
  83.  
  84.  
  85. FUNCTION InitCRM: CRMErr;
  86. FUNCTION CRMGetHeader: QHdrPtr;
  87. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  88. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  89. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  90. FUNCTION CRMGetCRMVersion: INTEGER;
  91. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  92. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  93. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  94. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  95. FUNCTION CRMGetNamedResource(theType: ResType; name: ConstStr255Param): Handle;
  96. FUNCTION CRMGet1NamedResource(theType: ResType; name: ConstStr255Param): Handle;
  97. PROCEDURE CRMReleaseResource(theHandle: Handle);
  98. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  99. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: ConstStr255Param): Handle;
  100. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  101. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  102. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  103. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  104. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  105. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  106. FUNCTION CRMIsDriverOpen(driverName: ConstStr255Param): BOOLEAN;
  107. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: LONGINT): CRMErr;
  108. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  109. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  110.  
  111. {$ALIGN RESET}
  112. {$POP}
  113.  
  114. {$SETC UsingIncludes := CommResourcesIncludes}
  115.  
  116. {$ENDC} {__COMMRESOURCES__}
  117.  
  118. {$IFC NOT UsingIncludes}
  119.  END.
  120. {$ENDC}
  121.